<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
        <title>物流托运</title>
        <link href="https://cdn.bootcss.com/framework7/1.6.5/css/framework7.ios.min.css" rel="stylesheet">
        <link href="https://cdn.bootcss.com/framework7/1.6.5/css/framework7.ios.colors.min.css" rel="stylesheet">
        <link rel="stylesheet" href="<?php echo IMG_PATH ?>bdkd/css/common.css" />
        <link rel="stylesheet" href="<?php echo IMG_PATH ?>bdkd/css/logistics.css" />
        <style>
            .qjrxx{
                color:#333 !important;
            }
            #qjxxxx{
                color:#333 !important;
            }
            .sjrxx{
                color:#333 !important;
            }
            #sjxxxx{
                color:#333 !important;
            }
        </style>
    </head>
    <body>
    <!-- <p><a style=" display:inline-block;width: 4rem; height: 2rem; border: 1px solid #006600;" href="javascript:window.location.reload()">刷新</a></p> -->
    <input type="hidden" name="sname" id="sname1" value="" >
    <input type="hidden" name="sphone" id="sphone1" value="" >
    <input type="hidden" name="gname" id="gname1" value="" >
    <input type="hidden" name="gphone" id="gphone1" value="" >
        <div class="intact">
            <div>
                <p></p>
            </div>
            <span>确定</span>
        </div>

        <div class="top">
            <div class="sender">
                <div><b></b></div>
                <div onclick="sendinfo()">
                    <input class="qjrxx" type="text" disabled="disabled" placeholder="发货人信息" value="" style="color: #333;"/>
                    <textarea id="qjxxxx" name="text" class="textb" disabled="disabled" placeholder="请输入详细的发货人信息,以便我们更好的为您服务" value="" style="border: none;color:black;" ></textarea>
                </div>
            </div>
            <div class="recipients">
                <div><b></b></div>
                <div onclick="getinfo()">
                    <input class="sjrxx" type="text" disabled="disabled" placeholder="收货人信息" value="" style="color: #333;"/>
                    <textarea id="sjxxxx" name="text" class="texta" disabled="disabled" class="shouhuorenxinxi" placeholder="请输入详细的收货人信息,以便我们更好的为您服务" value="" style="border: none;color: #333;" ></textarea>
                </div>
            </div>
        </div>
        

        <div class="content">
            <ul class="oul">
                <li class="genre">
                    <div>
                        <p>物品类型：</p>
                        <input type="text" name="" id="" placeholder="请说明您的托运物品" />
                        <!-- <img src="<?php echo IMG_PATH ?>bdkd/img/fanhui@2x.png"/> -->
                    </div>
                </li>
                <li class="company">
                    <div>
                        <p>物流公司：</p>
                        <span class="active">德邦物流</span>
                        <span>百世物流</span>
                        
                    </div>
                </li>
                <li class="freight">
                    <div class="con">
                        
                        <p>费用标准：</p>
                        <span>暂无数据</span>
                        
                    </div>
                </li>
                <li class="timer">
                    <div class="times">
                        <div><p>托运时间</p></div>
                        <div>
                            <input type="text" placeholder="9:00-10:00" readonly id="location" name="location">
                            <img src="<?php echo IMG_PATH ?>bdkd/img/fanhui@2x.png"/>
                        </div>
                    </div>
                </li>
                
                
                <li class="tell">
                    <div>
                        <p>请输入想对邮递员说的...（可不填）</p>
                        <textarea name="" rows="" cols="" placeholder="例：我需要包装" style="border:none; resize: none;" ></textarea>
                    </div>
                </li>
            </ul>   
        </div>
        
        
        <div class="pick">
            <div class="xieyi">
                <img src="<?php echo IMG_PATH ?>bdkd/img/ccc.png"/>
                <p>我已阅读并同意</p>
                <span>《便递服务协议》</span>
            </div>
            <div class="pick_up" onclick="send()">
                <p>开始托运</p>
                <div>
                    <img src="<?php echo IMG_PATH ?>bdkd/img/-@2x.png"/>
                    <span>限30-200公斤，超重请直接联系便递</span>
                </div>
            </div>
        </div>
    </body>
    
    
    <script type="text/javascript" src="<?php echo IMG_PATH ?>bdkd/js/jquery-1.11.0.js" ></script>
     <script type="text/javascript" src="<?php echo IMG_PATH ?>bdkd/js/rem.js" ></script>
    <script type="text/javascript" src="<?php echo IMG_PATH ?>bdkd/js/framework.min.js" ></script> 
    <script type="text/javascript" src="<?php echo IMG_PATH ?>bdkd/js/timesObject.js" ></script>
    <script type="text/javascript" src="<?php echo IMG_PATH ?>bdkd/js/times.js" ></script>
     <script>

         function send(){

             var sname=$(" input[ name='sname' ] ").val();
             var sphone=$(" input[ name='sphone' ] ").val();
             var gname=$(" input[ name='gname' ] ").val();
             var gphone=$(" input[ name='gphone' ] ").val();
             var saddress=$("#saddress").val();
             var gaddress=$("#gaddress").val();

             var wupin=$(".wupin").val();
             var xuqiu=$(".xuqiu").val();

             var remark=wupin+xuqiu;

             //选择托运公司
             var express_type= $(".suibian").val();
             //console.log(express_type);

             var time=$(" input[ name='location' ] ").val();


             $.ajax({
                 url:"<?php echo SITE_PATH ?>work/bexpress/logistics",
                 type:"post",
                 data:{
                     'sname': sname,
                     'sphone': sphone,
                     'gname': gname,
                     'gphone': gphone,
                     'saddress': saddress,
                     'gaddress': gaddress,
                     'time' : time,
                     'express_type': express_type,
                     'remark' : remark,
                 },
                 success: function(data){
                     console.log(data);
                     if(data.result==1){
                         alert('提交成功!');
                     }else {
                         alert(data.msg);
                     }
                 },
                 error: function(){
                     alert('提交失败0!');
                 }
//                async:"false";
             })
         }


        $(".company div span").on("click",function(){
            $(this).addClass("active").siblings().removeClass("active")
        })
        

        
        
    
 $(".pick_up").on("click",function(){
//      console.log($(".textb").val());
//      console.log($(".texta").val());
        if($(".textb").val()=="" && $(".texta").val()==""){
            $(".intact").show()
            $(".intact p").html("您的发货人和收货人信息均未填写，请完善")
            $(".intact span").on("click",function(){
                $(this).parent().hide()
            })
        }else if($(".textb").val()==""){
            $(".intact").hide()
            $(".intact p").html("您的发货人信息未填")
            $(".intact span").on("click",function(){
                $(this).parent().hide()
            })
        }else if($(".texta").val()==""){
            $(".intact").show()
            $(".intact p").html("您的收货人信息未填")
            $(".intact span").on("click",function(){
                $(this).parent().hide()
            })
        }
        
    })

        var Qjrxx=document.querySelector(".qjrxx");
        var Qjxxxx=document.querySelector("#qjxxxx");
        var Sjrxx=document.querySelector(".sjrxx");
        var Sjxxxx=document.querySelector("#sjxxxx");
        var g=localStorage;
        var fstr="";
        var fn=g.getItem('fname2');
        var fd=g.getItem('fdianhua2');
        $('#gname1').val(fn);
        $('#gphone1').val(fd);
        fstr += fn+'  '+fd;
        if(fn&&fd) {
            Qjrxx.value = fstr;
            Qjrxx.style.color = '#000';
        }
        var f ="";
        var fx=g.getItem('fdizhi2');
        f+=fx;
        if(fx){
            Qjxxxx.value = f;
            Qjxxxx.style.color='#000';
        }

        var sstr="";
        var sn=g.getItem('sname2');
        var sd=g.getItem('sdianhua2');
        $('#sname1').val(sn);
        $('#sphone1').val(sd);
        sstr+=sn+'  '+sd;
        if(sn&&sd) {
            // $(".Qjrxx").html(sstr) ;
            // $(".Qjrxx").css("color","#333");
            Sjrxx.value = sstr;
            Sjrxx.style.color = '#000';
        }
        var s ="";
        var sx=g.getItem('sdizhi2');
        var sxx=g.getItem('sxxxx2');
        s+=sx+sxx;
        if(sx&&sxx){
            Sjxxxx.value = s;
            console.log(2);
            Sjxxxx.style.color='#000';
            console.log(1);
        }

        function sendinfo() {

            window.location.href = '<?php echo SITE_PATH ?>work/bexpress/sendwu';
        }
        function getinfo() {
            window.location.href = '<?php echo SITE_PATH ?>work/bexpress/getwu';
        }
 
     </script>
     
</html>
